Vanilla validator compounding staking strategy#2905
Conversation
Refactored CompoundingStakingSSVStrategy to inherit CompoundingStakingStrategy. Removed ConsolidationController. Removed migrateClusterToETH.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## nicka/initial-deposit-32 #2905 +/- ##
============================================================
- Coverage 50.83% 45.06% -5.78%
============================================================
Files 110 110
Lines 4873 4920 +47
Branches 1353 1362 +9
============================================================
- Hits 2477 2217 -260
- Misses 2392 2699 +307
Partials 4 4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add registerSsvValidators and stakeEth forwarding functions to the old NativeStakingStrategy
… stored initialDepositAmountWei
* Fix contracts cron image pnpm version * Changed package.json to use pnpm
…icka/vanilla-staking
Added withdrawSsvClusterEth to the NativeStakingStrategy and CompoundingStakingSSVStrategy Deploy script now upgrades old NativeStakingStrategy and CompoundingStakingSSVStrategy
sparrowDom
left a comment
There was a problem hiding this comment.
I think there is another approach to vanilla staking where the risk of not being able to fully verify the deposit on-chain is transferred from trusting the node operator's honesty to trusting our strategist's honesty.
| { | ||
| ValidatorState currentState = validator[pubKeyHash].state; | ||
| require( | ||
| currentState == ValidatorState.NON_REGISTERED || |
There was a problem hiding this comment.
As per this comment we could allow for currentState == ValidatorState.STAKED to also admit a stake. This way we can:
- do an initial deposit of 1 ETH
- verify on beaconChain that it has been deposited
- reset the first deposit (ideally via a strategist action)
- deposit remaining 2029 ETH
We can not get front-run this way by the node operator. Extra risk is carried by the strategist though. I guess we are to decide who we can trust more.
There was a problem hiding this comment.
the problem with doing a 1 ETH deposit first is it currently takes 55 days for the deposit to be processed on the beacon chain. That's needed before the validator and deposit can be verified. It then takes another 55 days for the second 2029 ETH deposit to be processed. So that's 110 days if no yield.
While we have a large amount of ETH to deposit, we are taking on the risk that a large validator deposit could be front-run by the node operator.
There was a problem hiding this comment.
Agreed, the point I am trying to make is that we can do 1ETH & 2029ETH deposits both in 1 day. The verification that we aren't front ran can be done off-chain without waiting for the deposit to be processed by the beacon chain.
There was a problem hiding this comment.
It would be nice, but the staking contract would have to be changed to support this. Once the first initial deposit of 1 ETH is done, the validator status changes to STAKED. This prevents the second deposit from being made on the same day.
There was a problem hiding this comment.
Yes it would need to change (as proposed in the initial comment).
|
Claude's review 🔴 Blocker — 1. New implementation exceeds the EIP-170 size limit; migration 196 will fail to deploy on mainnet
Tests/compile pass locally only because Worth chasing: the committed config produces 25,077 bytes locally, yet the deployed mainnet artifact is only 24,223 bytes (854 smaller) — implying the Action: Before queuing 196, compile under the exact production profile and confirm runtime bytecode < 24,576 ( 🟠 High — 2. Off-chain
|
|
Thanks for your review @sparrowDom
|
…2914) * All removeSsvValidator to be called for the Compounding Staking SSV Strategy on the ConsolidationController * Split withdrawSsvClusterEth and removeStrategy into separate gov prop so the 10 validators can be removed post upgrade
* All removeSsvValidator to be called for the Compounding Staking SSV Strategy on the ConsolidationController * Split withdrawSsvClusterEth and removeStrategy into separate gov prop so the 10 validators can be removed post upgrade * Added back NON_REGISTERED check on registerSsvValidator
…use rebases) (#2911) * migrate contracts to Talso signer * fix fork tests * add the migration for the OGN rewards module * refactor deployment * add some comments * add base migration files * add remaining migrations for base and one for sonic * add hyperevm migration * remove the old relayer roles
🟠 N-1 (residual H2) —
|
* Migrate vault & cross-chain operators to the new Talos signer (+ unpause rebases) (#2911) * migrate contracts to Talso signer * fix fork tests * add the migration for the OGN rewards module * refactor deployment * add some comments * add base migration files * add remaining migrations for base and one for sonic * add hyperevm migration * remove the old relayer roles * Bump deploy numbers * Add prop id to deploy 196 script * Fix Hardhat task that deposits to compounding validators * Hardhat task support for different compounding staking strategies --------- Co-authored-by: Domen Grabec <grabec@gmail.com>
* Migrate vault & cross-chain operators to the new Talos signer (+ unpause rebases) (#2911) * migrate contracts to Talso signer * fix fork tests * add the migration for the OGN rewards module * refactor deployment * add some comments * add base migration files * add remaining migrations for base and one for sonic * add hyperevm migration * remove the old relayer roles * Bump deploy numbers * Add prop id to deploy 196 script * Clear error when SSV validator has already been registered --------- Co-authored-by: Domen Grabec <grabec@gmail.com>
|
Thanks @sparrowDom N-1 (residual H2) — stakeValidator --consol true submits a dummy BLS signature for a creating deposit N-2 (Low) — 197 removeStrategy relies on an unenforced, unsimulated lastVerifiedEthBalance ≈ 0 N-3 (Info) — overloaded NotRegisteredOrVerified error gives a misleading revert on the register path M-1 — Legacy NativeStakingSSVStrategy.withdrawSsvClusterEth sweeps the entire ETH balance, ignoring consensusRewards |
Summary
This PR splits the compounding staking strategy into a deployable vanilla strategy and an SSV-specific extension, then wires the deployment flow for migrating away from the old compounding SSV strategy.
CompoundingStakingStrategyCompoundingStakingSSVStrategyCompoundingStakingStrategyProxyfor vanilla compounding validatorsCompoundingStakingStrategyViewConsolidationControllerto target the new vanilla compounding strategyConsolidationControllerwithdrawSsvClusterEthsupport to SSV strategies so empty SSV cluster ETH can be recoveredresetFirstDepositto be called by either Governor or StrategistDetails
CompoundingStakingStrategynow contains the shared compounding validator logic:CompoundingStakingSSVStrategynow only contains SSV-specific behavior:registerSsvValidatorremoveSsvValidatorwithdrawSsvClusterEthREGISTERED,VERIFIED, orACTIVEstateThe vanilla strategy allows the first deposit to an unregistered validator:
NON_REGISTERED -> STAKEDVERIFIEDorACTIVEThe initial validator deposit amount can be configured up to
2048 ETH, and first deposits are allowed up to the storedinitialDepositAmountWei.CompoundingStakingSSVStrategy.registerSsvValidator()requires validators to be inNON_REGISTEREDstate before registration, preventing already-used orREMOVEDpubkeys from being registered again.First Deposit Reset
resetFirstDepositcan now be called by either:This lets the Strategist clear the first-deposit guard after the pending first deposit has been reviewed/handled, while still rejecting regular users.
SSV Cluster ETH Withdrawal
withdrawSsvClusterEthwas added to both:NativeStakingSSVStrategyCompoundingStakingSSVStrategyThe function is governor-only and withdraws ETH from an empty SSV cluster. Any ETH held by the strategy is wrapped to WETH and transferred back to the OETH Vault.
SSV cluster helpers now normalize migrated ETH clusters so
ethBalanceis treated as the clusterbalance.Consolidation
ConsolidationControllernow targets the newCompoundingStakingStrategyand supports:nativeStakingStrategy2as the source strategyCompoundingStakingSSVStrategyfor post-upgrade validator removalIt forwards old native staking operations through to
nativeStakingStrategy2, including:registerSsvValidatorsstakeEthdoAccountingexitSsvValidatorremoveSsvValidatorIt also forwards target strategy operations needed during consolidation:
snapBalancesverifyBalancesvalidatorWithdrawalstakeEthDeploy Scripts
199_deploy_compounding_staking_strategy.js:CompoundingStakingSSVStrategyimplementationNativeStakingSSVStrategyimplementationCompoundingStakingStrategyProxyCompoundingStakingStrategy2030 ETHinitial validator deposit amountBeaconProofsCompoundingStakingStrategyViewConsolidationControllerGovernance proposal actions:
CompoundingStakingSSVStrategyProxyNativeStakingSSVStrategy2ProxynativeStakingStrategy2registrator to the new controller200_remove_old_compounding_ssv_strategy.js:On fork tests, script 200 simulates removing the 10 old compounding SSV validators so the cleanup proposal can be tested end-to-end.
Operational Flow
validatorCount == 0.CompoundingStakingSSVStrategyProxyfrom the OETH Vault.Testing
19382671998612Dependencies
This change is dependent on:
Code Change Checklist
To be completed before internal review begins:
Internal review: